home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ccdl150l.zip
/
STARTUP
/
ENVSET.C
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
525b
|
28 lines
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <libp.h>
char **_env_arr;
#pragma startup envset 19
void envset(void)
{
int count = _ll_getenv(0,0),i;
if (count) {
_env_arr = malloc(sizeof(char *)*(count+1));
for (i=1; i<=count; i++) {
char buf[1024];
_ll_getenv(buf,i);
_env_arr[i-1] = malloc(strlen(buf)+1);
strcpy(_env_arr[i-1],buf);
}
_env_arr[count] = 0;
}
else {
_env_arr = malloc(sizeof(char *));
_env_arr[0] = 0;
}
}